<?php
function getTitle(){
if ($_SERVER['PHP_SELF']=="/index.php") return "Home"; 
 if ($_SERVER['PHP_SELF']=="/inc/search.php") return "Search";  
if ($_SERVER['PHP_SELF']=="/inc/cart.php") return "Cart";  
if ($_SERVER['PHP_SELF']=="/inc/poll.php") return "Poll";  
    if ($_SERVER['PHP_SELF']=="/inc/spinner.php") return "Spinner";  
    if ($_SERVER['PHP_SELF']=="/inc/settings.php") return "Setting";
    if ($_SERVER['PHP_SELF']=="/inc/viewpost.php") return "View";
    if ($_SERVER['PHP_SELF']=="/inc/niche.php") return "Niches";
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title><?php echo getTitle(); ?></title>
	<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" />
	<link rel="stylesheet" href="../css/bootstrap.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="../css/jquery.treeview.css" />
	<!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
        <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->
	
	<script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/script.js"></script>
    <script type="text/javascript" src="../js/jquery.cookie.js"></script>
	<script type="text/javascript" src="../js/bootstrap.min.js"></script>
    
</head>

<body>
<div id="d3-page-background-middle-texture">
<div id="d3-main">
    <div class="cleared reset-box"></div>
    <div class="d3-header">
        <div class="d3-header-position">
            <div class="d3-header-wrapper">
                <div class="cleared reset-box"></div>
                <div class="d3-header-inner">
				<div class="d3-headerobject"></div>
                <div class="d3-logo">                          
                </div>
                </div>
            </div>
        </div>
        
    </div>
    <div class="cleared reset-box"></div>
<div class="d3-bar d3-nav">
<div class="d3-nav-outer">
<div class="d3-nav-wrapper">
<div class="d3-nav-inner">
	<ul class="d3-hmenu">
 
            
   <?php
   //000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
if (Am_Lite::getInstance()->isLoggedIn()){
$logout = Am_Lite::getInstance()->getLogoutURL();
$profileURL = Am_Lite::getInstance()->getProfileURL(); 
//есть в амембере------------------------
        ?>
                <li id = "mainpage">
			<a href="/" <?php if ($_SERVER['PHP_SELF']=="/index.php") echo "class=\"active\"" ?>>Home</a>
		</li>	
		<li id = "searchpage">
			<a href="/inc/search.php" <?php if ($_SERVER['PHP_SELF']=="/inc/search.php") echo "class=\"active\"" ?> >Search</a>
		</li>
                <li id = "niches">
			<a href="/inc/niche.php" <?php if ($_SERVER['PHP_SELF']=="/inc/niche.php") echo "class=\"active\"" ?> >Niches</a>
		</li>
                <li id = "basketpage">
			<a href="/inc/cart.php" <?php if ($_SERVER['PHP_SELF']=="/inc/cart.php") echo "class=\"active\"" ?> >Cart</a>
		</li>
                 <li id = "pollpage">
			<a href="/inc/poll.php" <?php if ($_SERVER['PHP_SELF']=="/inc/poll.php") echo "class=\"active\"" ?> >Poll</a>
		</li>
                <li id = "tbspage">
			<a href="/inc/spinner.php" <?php if ($_SERVER['PHP_SELF']=="/inc/spinner.php") echo "class=\"active\"" ?> >Spinner</a>
		</li>
                <li id = "profile">
			<a href="<?= $profileURL ?>">Client Area</a>
		</li>
                <li id = "options">
			<a href="/inc/settings.php" <?php if ($_SERVER['PHP_SELF']=="/inc/settings.php") echo "class=\"active\"" ?> >Settings</a>
		</li>
                <li id = "exit">
			<a href="<?= $logout ?>">Logout</a>
		</li>

<?php
/*
    echo "<script>
        $(document).ready(function() {
        $(\"#adminpage\").hide();
        })</script>";*/
}elseif($_SESSION['loggedin']){
    //есть в админке-------
    $logout = "/?logout=1";
    ?>
            <li id = "mainpage">
			<a href="/" <?php if ($_SERVER['PHP_SELF']=="/index.php") echo "class=\"active\"" ?>>Home</a>
		</li>	
		<li id = "searchpage">
			<a href="/inc/search.php" <?php if ($_SERVER['PHP_SELF']=="/search.php") echo "class=\"active\"" ?> >Search</a>
		</li>
                <li id = "niches">
			<a href="/inc/niche.php" <?php if ($_SERVER['PHP_SELF']=="/inc/niche.php") echo "class=\"active\"" ?> >Niches</a>
		</li>
		<li id = "adminpage">
			<a href="/inc/admin.php" <?php if ($_SERVER['PHP_SELF']=="/inc/admin.php") echo "class=\"active\"" ?>  >Admin</a>
		</li>
                <li id = "basketpage">
			<a href="/inc/cart.php" <?php if ($_SERVER['PHP_SELF']=="/inc/cart.php") echo "class=\"active\"" ?> >Cart</a>
		</li>
                 <li id = "pollpage">
			<a href="/inc/poll.php" <?php if ($_SERVER['PHP_SELF']=="/inc/poll.php") echo "class=\"active\"" ?> >Poll</a>
		</li>
                <li id = "tbspage">
			<a href="/inc/spinner.php" <?php if ($_SERVER['PHP_SELF']=="/inc/spinner.php") echo "class=\"active\"" ?> >Spinner</a>
		</li>
                <li id = "options">
			<a href="/inc/settings.php" <?php if ($_SERVER['PHP_SELF']=="/inc/settings.php") echo "class=\"active\"" ?> >Settings</a>
		</li>
                <li id = "exit">
			<a href="<?= $logout ?>">Logout</a>
		</li>
    
    
    
    
<?php
  
  /*  
    
    echo "<script>
        $(document).ready(function() {
        $(\"#profile\").hide();
        })</script>";
   
   */
    
}else{
        //нет нигде-----
   /* ?>
             <li id = "mainpage">
			<a href="/" <?php if ($_SERVER['PHP_SELF']=="/index.php") echo "class=\"active\"" ?>>Главная</a>
		</li>	
		<li id = "searchpage">
			<a href="/inc/search.php" <?php if ($_SERVER['PHP_SELF']=="/search.php") echo "class=\"active\"" ?> >Поиск</a>
		</li>	
                <li id = "basketpage">
			<a href="/inc/cart.php" <?php if ($_SERVER['PHP_SELF']=="/inc/cart.php") echo "class=\"active\"" ?> >Корзина</a>
		</li>
                 <li id = "pollpage">
			<a href="/inc/poll.php" <?php if ($_SERVER['PHP_SELF']=="/inc/poll.php") echo "class=\"active\"" ?> >Голосовалка</a>
		</li>
                <li id = "tbspage">
			<a href="/inc/spinner.php" <?php if ($_SERVER['PHP_SELF']=="/inc/spinner.php") echo "class=\"active\"" ?> >TBS</a>
		</li>

    
 <?php   
    * 
    */
    

    //$logout = "";
    /*
    echo "<script>
        $(document).ready(function() {
        $(\"#exit\").hide();
        $(\"#profile\").hide();
        })</script>";
    
     */
}
//0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
?>         

	</ul>
</div>
</div>
</div>
</div>
<div class="cleared reset-box"></div>
<div class="d3-box d3-sheet">
        <div class="d3-box-body d3-sheet-body">
            <div class="d3-layout-wrapper">
                <div class="d3-content-layout">
                    <div class="d3-content-layout-row">
                        <div class="d3-layout-cell d3-content">
						<div class="d3-box d3-post">
							<div class="d3-box-body d3-post-body">
                                                            <div class="d3-post-inner d3-article">